Note: We do not regularly update these examples with new versions. You may have to modify the code to use newer versions.
The REALbasic (Xojo) examples were originally created in REAL Studio 2010r5, and converted to REAL Studio 2011r1.1, and later versions. We also tested with Xojo 2019r3.1 and Xojo 2020r1.2.
It appears to be impossible to enumerate COM collections using any built-in construct, or accessing the GetEnumerator method in Xojo. With most collections, you can, however, obtain the Count property of the collection, and then access the individual elements using the Item property, which is "indexed" by an integer, from 0 to Count - 1.
Some collections in QuickOPC are, however, keyed collections, where the key is not an integer (or it might be an integer but it does not represent a sequential index into the collection). There is no direct way to enumerate elements of such keyed collections in Xojo.
To enumerate such collections, we recommend following workaround: Create an instance of ElasticVector Collection object, and call its AddRange Method, passing it the keyed collection you want to enumerate. This will effectively convert the key collection to an elastic vector, and you can then use the Item Property of the elastic vector (indexed by an integer) to access all elements of the original collection in a sequence.